#define _CRT_SECURE_NO_WARNINGS 1

# include<bits/stdc++.h>
using namespace std;

typedef long long ll;


int main()
{
    int n = 0;
    cin >> n;
    ll min_v = -1, max_v = 1e9, a = 0, b = 0;
    for (int i = 0; i < n; ++i)
    {
        cin >> a >> b;
        min_v = max(min_v, a / (b + 1) + 1);
        max_v = min(max_v, a / b);
    }
    cout << min_v << " " << max_v;
    return 0;
}